﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GameSchool.Models
{
	public class VideoRepository
	{
		VideoDBContextDataContext db = new VideoDBContextDataContext();
		public IEnumerable<Video> Videos()
		{
			return db.Videos;
		}

		public void Save()
		{
			db.SubmitChanges();
		}

		public void Add(Video newVideo)
		{
			db.Videos.InsertOnSubmit(newVideo);
		}

		public void Delete(Video deleteVideo)
		{
			db.Videos.DeleteOnSubmit(deleteVideo);
		}
	}
}